<template>
    <view>
        <test-a v-if="type==='testA'"></test-a>
        <test-b v-if="type==='testB'"></test-b>
        <test-c v-if="type==='testC'"></test-c>
        <!-- <component :is="type"></component> -->
        <button @click="buttonTap">GOTO</button>
    </view>
</template>

<script>
    import testA from './components/testA.vue'
    import testB from './components/testB.vue'
    import testC from './components/testC.vue'
    export default {
        components: { testA, testB, testC },
        data() {
            return {
                type: ''
            }
        },
        onLoad(...options){
            //  自己打印来看看咯
			console.log(options)
			console.log(this.$Route)
            const f = require(`./config/${this.$Route.query.type}.js`).default
            console.log(f)
            const data = f()
            console.log(data)
            this.type = data.type


            // this.type = this.$Route.query.type
		},
        methods: {
            buttonTap() {
                console.log(this.$Router)
                this.$Router.push({
                    name:'MD',
                    params:{
                        type: 'testB'
                    }
                })
            }
        }
    }
</script>

<style lang="scss" scoped>

</style>